<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>元素转换</title>
    <script type="text/javascript" src="https://vuejs.org/js/vue.js"></script>
    <style>
        .fade-enter-active, .fade-leave-active{
            transition: opacity 2s;
        }
        .fade-enter, .fade-leave-active{
            opacity:0;
        }
        p{
            margin: 0;
            position: absolute;
            font-size:3em;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="kisses++">💋kiss!</button>
    <transition name="fade">
        <p v-if="kisses < 3" key="frog">🐸frog</p>
        <p v-if="kisses >= 3 && kisses <= 5" key="princess">👸princess</p>
        <p v-else key="santa">🎅🏻santa</p>
    </transition>
</div>

<script>
    new Vue({
        el: '#app',
        data:{
            kisses: 0
        }
    })
</script>
</body>
</html>